#include <iostream>
#include <fstream>
#include <string>
using std::cout;
using std::cerr;
using std::endl;
using std::ifstream;
using std::string;

void test0(){
    ifstream ifs;
    //文件要存在，不存在会使ifs进入failbit状态
    ifs.open("explicit.cc");

    if(!ifs){
        cerr << "ifstream open file failed!" << endl;
        return;
    }

    string word;
    while(ifs >> word){
        cout << word << endl;
    }
}

int main(void){
    test0();
    return 0;
}
